package streamLogStaticJava.pojos;

import com.google.gson.Gson;
import org.apache.flink.api.common.serialization.AbstractDeserializationSchema;

import java.io.IOException;

/**
 * @ClassName LogbeanSchema
 * @Description TODO
 * @Author dalong
 * @Date 2020/6/22 21:22
 * @Version 1.0
 **/

public class LogbeanSchema extends AbstractDeserializationSchema<logbean>{

    @Override
    public logbean deserialize(byte[] bytes) throws IOException {
        Gson gson = new Gson();
        String sourceStr = new String(bytes, "UTF-8");
        logbean logbean = gson.fromJson(sourceStr, logbean.class);
        return logbean;
    }
}
